package sg.edu.nus.iss.vmcs.termination.template;

import java.util.Observable;

import sg.edu.nus.iss.vmcs.customer.CoinReceiver;

/**
 * Author : Priyanka
 * Termination on Dispensing , part of Template Method Design Pattern 
 * 
 */

public class TerminationOnDispense extends Termination {
	
CoinReceiver coinReceiver;
	
	public TerminationOnDispense(Observable coinReceiver2) {
		super();
		this.coinReceiver = (CoinReceiver)coinReceiver2;
	}
	
	@Override
	protected void CallUseCase() {
		
		System.out.println("Template Method : Termination on DispenseDrinkState state");
		refundCash();		
	}

	private void refundCash()
	{
		coinReceiver.refundCash();		
	}
}
